package com.logs.javalog;

import java.io.IOException;
import java.util.logging.*;

/**
 * Created by pengfei on 16/7/12.
 */
public class LogTest {
    public static void main(String[] args) throws IOException {
        Logger log = Logger.getLogger(LogTest.class.getName());
        log.setLevel(Level.ALL);

        FileHandler fileHandler = new FileHandler("./logs/javalog/LogTest.log");
        fileHandler.setLevel(Level.ALL);
        fileHandler.setFormatter(new SimpleFormatter());
        log.addHandler(fileHandler);

        SocketHandler socketHandler = new SocketHandler("localhost",9090);
        log.addHandler(socketHandler);


        log.warning("hello hello hello how are you ");
    }
}
